﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Browser;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace RunDesktopApplication
{
    public partial class MainPage : UserControl
    {
        //[ScriptableType()]
        public MainPage()
        {
            InitializeComponent();
        }

        [ScriptableMember]
        public void Run(string port,string key, string[] parameters)
        {
            if (parameters != null)
            {
                for (int i = 0; i < parameters.Length; i++)
                {

                }
            }

            Uri uri = new Uri("http://localhost:" + port + "/Run?key="+key+"&params=");
            var client = new WebClient();
            client.OpenReadCompleted += client_OpenReadCompleted;
            client.OpenReadAsync(uri);

        }

        private void client_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
        {
            if (this.ActualHeight!=this.ActualHeight)
            {
                if (this.ActualHeight != this.ActualHeight)
                {
                    
                }
            }
        }

    }
}
